# common
set $mod Mod4

# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod

# start a terminal
bindsym $mod+Return exec urxvt

# kill focused window
bindsym $mod+Shift+q kill

assign [class="TelegramDesktop"] $workspace8
assign [class="Firefox"] $workspace1
assign [class="KeePass2"] $workspace7
assign [class="Deluge"] $workspace6
assign [class="Qemu-system-x86_64"] $workspace5
assign [class="NetBeans IDE 8.2"] $workspace9

for_window [class="KeePass2"] move to workspace $workspace7 floating enable
for_window [class="KeePass2"] move position center 
for_window [class="Sxiv|feh|MuPDF|mpv|ncmpcpp|MComix|libreoffice*"] floating enable resize set $h $w
for_window [class="Sxiv|feh|MuPDF|mpv|ncmpcpp|MComix|libreoffice*"] move position center 
for_window [class="URxvt" title="ranger|ncmpcpp"] floating enable resize set $h $w
for_window [class="URxvt" title="ranger|ncmpcpp"] move position center
for_window [class="URxvt" title="neomutt"] move to workspace $workspace4
for_window [class="^.*"] border pixel 3

# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right

# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right

# move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right

# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right

# split in horizontal orientation
bindsym $mod+o split v

# split in vertical orientation
bindsym $mod+v split h

# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle

# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split

# toggle tiling / floating
bindsym $mod+Shift+space floating toggle

# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle

# focus the parent container
bindsym $mod+a focus parent

bindsym $mod+1 workspace $workspace1
bindsym $mod+2 workspace $workspace2
bindsym $mod+3 workspace $workspace3
bindsym $mod+4 workspace $workspace4
bindsym $mod+5 workspace $workspace5
bindsym $mod+6 workspace $workspace6
bindsym $mod+7 workspace $workspace7
bindsym $mod+8 workspace $workspace8
bindsym $mod+9 workspace $workspace9
bindsym $mod+0 workspace $workspace10

# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $workspace1
bindsym $mod+Shift+2 move container to workspace $workspace2
bindsym $mod+Shift+3 move container to workspace $workspace3
bindsym $mod+Shift+4 move container to workspace $workspace4
bindsym $mod+Shift+5 move container to workspace $workspace5
bindsym $mod+Shift+6 move container to workspace $workspace6
bindsym $mod+Shift+7 move container to workspace $workspace7
bindsym $mod+Shift+8 move container to workspace $workspace8
bindsym $mod+Shift+9 move container to workspace $workspace9
bindsym $mod+Shift+0 move container to workspace $workspace10

# reload the configuration file
bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart

# resize window (you can also use the mouse for that)

mode "resize" {
        bindsym h resize shrink width 50 px or 50 ppt
        bindsym j resize grow height 50 px or 50 ppt
        bindsym k resize shrink height 50 px or 50 ppt
        bindsym l resize grow width 50 px or 50 ppt

        bindsym Left resize shrink width 50 px or 50 ppt
        bindsym Down resize grow height 50 px or 50 ppt
        bindsym Up resize shrink height 50 px or 50 ppt
        bindsym Right resize grow width 50 px or 50 ppt

        bindsym Return mode "default"
}

bindsym $mod+r mode "resize"

bindsym Mod1+Tab workspace back_and_forth
bindsym $mod+shift+x exec i3lock --image=/home/sasaki/Images/random/i3lock.png
bindsym $mod+shift+g exec urxvt -e ranger
bindsym $mod+shift+d exec urxvt -e rtv --enable-media
bindsym $mod+shift+m exec urxvt -e ncmpcpp
bindsym $mod+shift+u exec urxvt -e neomutt
bindsym --release Print exec "import png:- | xclip -selection clipboard -t image/png"
bindsym --release Shift+Print exec "import ~/Images/$(date +%s).png"
bindsym --release Control+Print exec "import -window root ~/Images/$(date +%s).png"
bindsym $mod+shift+t exec telegram-desktop
bindsym $mod+Control+l workspace next
bindsym $mod+Control+h workspace prev
bindsym $mod+shift+s exec ~/.scripts/i3themes
bindsym $mod+m exec ~/.scripts/usb_mount mount
bindsym $mod+u exec ~/.scripts/usb_mount
bindsym $mod+shift+o exec libreoffice ~/Documents/oth/moneey.ods
bindsym Control+Q ;

# Pulse Audio controls
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% && pkill -RTMIN+10 i3blocks #increase sound volume
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% && pkill -RTMIN+10 i3blocks #decrease sound volume
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle && pkill -RTMIN+10 i3blocks #mute volume

# Media player controls
bindsym XF86AudioPlay exec mpc toggle
bindsym XF86AudioStop exec mpc stop
bindsym XF86AudioPause exec mpc pause
bindsym XF86AudioNext exec mpc next
bindsym XF86AudioPrev exec mpc prev 

exec firefox www.archlinux.org globoesporte.globo.com www.gazetaesportiva.com/times/santos thehackernews.com
exec telegram-desktop
exec chromium https://www.youtube.com/feed/subscriptions https://www.youtube.com/playlist?list=WL
exec urxvt -e neomutt
exec_always ~/.fehbg

### prevent the screen to switch off after some time ###
exec xset s off
exec xset -dpms


